package com.bluejazz.application.service;

import com.bluejazz.controller.vo.OrderVO;
import com.bluejazz.exception.OrderException;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class OrderService {
    public OrderVO getOrder(Integer orderId) {
        OrderVO orderVO = new OrderVO();
        orderVO.setOrderId(orderId);
        orderVO.setAmount(new BigDecimal("3.14"));
        return orderVO;
    }

    public OrderVO getOrderFail() {
        if (true)
            throw new OrderException("it just happened");
        return new OrderVO();
    }

    public String foo() {
        int a = 1;
        int b = a / 0;
        return "OK";
    }
}
